<template>
  <div class="manage">
    <el-card class="box-card1">

    </el-card>
    <el-card class="box-card" style="margin-top:15px">
      <div slot="header" class="clearfix">
        <div style="display: flex;justify-content: space-between;align-items: center;">
          <p style="font-weight:800"> 以下是本公司提交的人员申诉记录</p>
        </div>
      </div>
      <el-table :data="tableData" style="width: 100%" :header-cell-style="{ 
      fontWeight:800}" @selection-change="handleSelectionChange">
        <el-table-column type="index" label="序号" width="60">
        </el-table-column>
        <el-table-column prop="realName" label="姓名">
        </el-table-column>
        <el-table-column prop="identityCard" label="身份证">
        </el-table-column>
        <el-table-column prop="createTime" label="处理时间">
        </el-table-column>
        <el-table-column prop="orgName" label="单位名称">
        </el-table-column>
        <el-table-column prop="result" label="当前状态">
          <template slot-scope="scope">
            {{resultArr[scope.row.result]}}
          </template>
        </el-table-column>
        <!-- <el-table-column prop="userName" label="被申诉方DT号">
        </el-table-column> -->
        <el-table-column prop="phonenumber" label="被申诉方联系电话">
        </el-table-column>
      </el-table>
      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="pagination.pageNum"
        :page-size="pagination.pageSize" :page-sizes="[10, 20, 50]" layout="total, sizes, prev, pager, next, jumper" :total="pagination.pageTotal">
      </el-pagination>
    </el-card>
  </div>
</template>

<script>
import { getselectWorkerAppealPage } from '@/api/people'
export default {
  data () {
    return {
      resultArr: {
        0: '不同意',
        1: '同意',
        2: '系统处理',
        3: '等待处理'
      },
      pagination: {
        pageTotal: 0,
        pageSize: 10,
        pageNum: 1,
      },
      tableData: []
    }
  },
  mounted () {
    this.gettableList()
  },
  methods: {
    gettableList () {
      const query = {
        pageSize: this.pagination.pageSize,
        pageNum: this.pagination.pageNum,
      }
      getselectWorkerAppealPage(query).then(res => {
        if (res.data.code == '200') {
          this.pagination.pageTotal = res.data.data.total
          this.tableData = res.data.data.list
        }
      })
    },
    handleSizeChange (val) {
      this.pagination.pageNum = 1
      this.pagination.pageSize = key
      console.log(`每页 ${val} 条`)
    },
    handleCurrentChange (val) {
      this.pagination.pageNum = key
      console.log(`当前页: ${val}`)
    },
    handleSelectionChange (val) {
      this.multipleSelection = val
    }
  }
}

</script>
<style lang="less" scoped>
::v-deep .el-form-item__label {
  font-weight: bold;
}
.manage {
  .el-pagination {
    margin-top: 2vh;
    text-align: right;
  }
}
</style>>
